package year2019.month01;

/**
 * @desc 描述
 * create on 2019/1/2 by watson
 */
public class MainTest {

    public static void main(String[] args){
//        MainTest.testExtends();
        MainTest.testAnnotations();

    }


    public static void testAnnotations(){
        char[] chars = "arg".toCharArray();
        chars.getClass();


//        int i = 10;

//        int.class.getFields()

    }


    public static void testExtends(){

        Integer i = new Integer(10);
        Double d = new Double(10.1);

        Number numI = i;
        Number numD = d;

        System.out.println("numD:"+numD);

        d = (Double) numD;
        System.out.println("d:"+d);

        numD = numI;
        System.out.println("numD:"+numD);

        d = (Double) numD;  //转型失败
        System.out.println("d:"+d);

        /*if (numD instanceof Double){
            d = (Double) numD;
            System.out.println("d:"+d);
        } else {
            System.out.println("类型不相同");
        }*/

    }

}
